import 'package:high_help_apps/common/entities/user/user_login_response_entity.dart';

userLoginResponseEntityFromJson(UserLoginResponseEntity data, Map<String, dynamic> json) {
	if (json['success'] != null) {
		data.success = json['success'];
	}
	if (json['code'] != null) {
		data.code = json['code'] is String
				? int.tryParse(json['code'])
				: json['code'].toInt();
	}
	if (json['message'] != null) {
		data.message = json['message'].toString();
	}
	if (json['detail'] != null) {
		data.detail = UserLoginResponseDetail().fromJson(json['detail']);
	}
	return data;
}

Map<String, dynamic> userLoginResponseEntityToJson(UserLoginResponseEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['success'] = entity.success;
	data['code'] = entity.code;
	data['message'] = entity.message;
	data['detail'] = entity.detail?.toJson();
	return data;
}

userLoginResponseDetailFromJson(UserLoginResponseDetail data, Map<String, dynamic> json) {
	if (json['uid'] != null) {
		data.uid = json['uid'] is String
				? int.tryParse(json['uid'])
				: json['uid'].toInt();
	}
	if (json['token'] != null) {
		data.token = json['token'].toString();
	}
	if (json['email'] != null) {
		data.email = json['email'].toString();
	}
	return data;
}

Map<String, dynamic> userLoginResponseDetailToJson(UserLoginResponseDetail entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['uid'] = entity.uid;
	data['token'] = entity.token;
	data['email'] = entity.email;
	return data;
}